Implementing Generalized Operator Overloading

نویسندگان

  • William S. Miles
  • Leroy Johnson
چکیده

This paper presents a practical method of adding problem-specific notation to an established computer language. Our idea is to use unrestricted operator overloading as a tool to map the problem domain notation directly into an existing programming language. Our method introduces new operator symbols and function names into a host language by overloading existing usage. We extend the host programming language syntax to an augmented language which is mapped to the host language by a programmable preprocessor. The preprocessor uses a programmer-modifiable symbolic language grammar to translate an augmented program into a standard program. This process gives a natural extension to any computer language without modifying the host language. Direct use of problem notation can improve program legibility and code comprehension within the problem domain. The preprocessor provides a useful research tool for exploring language issues without the need to write a compiler for a new language. It can also be used to provide a domain specific language for a programming group at lower cost than new language development. This paper presents several working examples which illustrate our work. We redefine many of the standard C operators to alleviate some of the more common programming errors, thus creating a “cleaner” C. As a more esoteric example, we encode a subset of APL vector operators as an algebraic extension to the C language. A curious application of our method shows its success in an arbitrary problem domain by compiling and executing poetry. Our final example introduces standard symbolic logic notation into C for tautology verification.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Operator Overloading in C

This thesis is concerned with investigating an approach for adding problem notation to a computer language. A method is proposed for modifying a programming language to fit problem notation by including the capability of defining a problem specific set of symbols or operators in the language. The proposed method for extending a language uses operator overloading to map language operations to th...

متن کامل

Some generalized Bonferroni mean operators with 2-tuple linguistic information and their application to multiple attribute decision making

In this paper, we investigate the multiple attribute decision making problems with 2-tuple linguistic information. Motivated by the ideal of generalized weighted Bonferroni mean and generalized weighted geometric Bonferroni mean, we develop the 2-tuple linguistic generalized Bonferroni mean (2TLGBM) operator for aggregating the 2-tuple linguistic information and 2-tuple linguistic generalized g...

متن کامل

A system for reflection in C++

Object-oriented programming languages such as Java and Objective C have become popular for implementing agent-based and other objectbased simulations since objects in those languages can reflect (i.e. make runtime queries of an object’s structure). This allows, for example, a fairly trivial serialisation routine (conversion of an object into a binary representation that can be stored or passed ...

متن کامل

Fixed Sequences for a Generalization of the Binomial Interpolated Operator and for some Other Operators

This paper is devoted to the study of eigen-sequences for some important operators acting on sequences. Using functional equations involving generating functions, we completely solve the problem of characterizing the fixed sequences for the Generalized Binomial operator. We give some applications to integer sequences. In particular we show how we can generate fixed sequences for Generalized Bin...

متن کامل

Fixed-point Simulation Utility for C and C++ Based Digital Signal Processing Programs

This utility software automatically converts a oating-point digital signal processing program written in C or C++ language to a xed-point program. The conversion is conducted by deening a new xed-point data class and utilizing the operator overloading characteristic of the C++ language. A generalized xed-point format which consists of the wordlength, integer wordlength, sign, overrow, and quati...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Softw., Pract. Exper.

دوره 28  شماره 

صفحات  -

تاریخ انتشار 1998